package com.juyou.rider.app.api.order;


import com.laituo.juyou.core.annotation.HttpMethod;
import com.laituo.juyou.core.annotation.HttpOpenApi;
import com.laituo.juyou.core.annotation.HttpParam;
import com.laituo.juyou.core.annotation.HttpParamType;
import com.laituo.juyou.core.annotation.param.NotNull;
import com.laituo.juyou.core.exception.AdminServiceException;
import com.laituo.juyou.core.exception.AppServiceException;
import com.laituo.juyou.core.exception.ServiceException;
import com.laituo.juyou.data.domain.RiderDO;
import com.laituo.juyou.data.domain.RiderOrderDO;
import com.laituo.juyou.data.domain.RiderWithDrawDO;
import com.laituo.juyou.data.dto.order.OrderRiderDTO;
import com.laituo.juyou.data.dto.rider.RiderLoginDTO;
import com.laituo.juyou.data.model.Page;

import java.math.BigDecimal;
import java.rmi.ServerException;

/**
 * @description: 骑手提现
 * @author: xuyang
 * @date: 2020/03/03 21:02
 **/
@HttpOpenApi(group = "app.riderWithDraw", description = "骑手提现")
public interface RiderWithDrawService {
    /**
     * 获取提现申请列表
     *
     * @param pageNo    页码
     * @param pageSize  页码长度
     * @param riderName 骑手名称
     * @param status    状态
     * @return Page<OrderRiderDTO>
     * @throws ServerException 异常
     */
    @HttpMethod(description = "获取提现申请列表")
    public Page<RiderWithDrawDO> getRiderWithDrawPage(
            @HttpParam(name = "page", type = HttpParamType.COMMON, description = "页码", valueDef = "1") Integer pageNo,
            @HttpParam(name = "pageSize", type = HttpParamType.COMMON, description = "页码长度", valueDef = "10") Integer pageSize,
            @HttpParam(name = "riderName", type = HttpParamType.COMMON, description = "骑手名称") String riderName,
            @HttpParam(name = "status", type = HttpParamType.COMMON, description = "状态") String status) throws ServerException;

    /**
     * 新增提现
     *
     * @param riderId  骑手id
     * @param withDraw 提现金额
     * @return Boolean
     * @throws ServerException 异常
     */
    @HttpMethod(description = "提现申请")
    public Boolean addWithDraw(
            @HttpParam(name = "riderId", type = HttpParamType.RIDER_ID, description = "骑手id") Long riderId,
            @HttpParam(name = "withDraw", type = HttpParamType.COMMON, description = "提现金额") BigDecimal withDraw) throws ServerException, AppServiceException;

    /**
     * 修改提现状态
     *
     * @param id 骑手id
     * @param userId  用户id
     * @return Boolean
     * @throws ServerException 异常
     */
    @HttpMethod(description = "修改提现状态")
    public Boolean updateStatus(
            @HttpParam(name = "id", type = HttpParamType.COMMON, description = "提现id") Long id,
            @HttpParam(name = "adminId", type = HttpParamType.ADMIN_ID, description = "用户id") Long adminId,
            @HttpParam(name = "riderId", type = HttpParamType.COMMON, description = "骑手id") Long riderId,
            @HttpParam(name = "status", type = HttpParamType.COMMON, description = "状态", valueDef = "1") String status,
            @HttpParam(name = "withDraw", type = HttpParamType.COMMON, description = "提现金额") BigDecimal withDraw) throws ServerException, AppServiceException;


    /**
     * 查询总金额
     *
     * @param riderId 骑手id
     * @return Boolean
     * @throws ServerException 异常
     */
    @HttpMethod(description = "查询总金额")
    public RiderDO queryBalanceById(
            @HttpParam(name = "riderId", type = HttpParamType.RIDER_ID, description = "骑手id") Long riderId) throws ServerException;
}
